using System.Text;
using System;
using System.Collections.Generic;
using AmazeUI;
using AmazeUI.Imodel;
namespace AmazeUI.db
{
    public partial class XtUser : ILoginModel
    {
        
        public XtUser(IXtUser model)
            : this()
        {
            SetModel(model);

            this.LogTime = this.DisTime = this.AddTime = DateTime.Now;
            this.EnaTime = DateTime.Now.AddYears(100);
            this.IsUsing = true;
            this.LogNum = 0;
            
        }
        public void SetModel(IXtUser model)
        {
            this.UserName = model.UserName;
            this.Name = model.Name;
            this.Pwd = model.Pwd;
            this.RoleId = model.RoleId;
            this.UsingIp = model.UsingIp;
            this.Rmark = model.Rmark;
            this.ImgUrl = model.ImgUrl;
            this.IsUsing = model.IsUsing;
            this.AreaId = model.AreaId;  
            
        }

        public string[] Roles
        {
            get { return this.XtRole.Powers.Split('|'); }
            set{}
        }
    }
}
